﻿#pragma once
#include "db_conn_pool.h"
#include "mysql.h"
//class mysql
//{
//
//};



class mysql_pool : public db_conn_pool<sql::Connection>
{
public:
	~mysql_pool() {}
	static mysql_pool& get_instance();

	void setParam(const std::string& conn_str_addr, const std::string& conn_str_user, const std::string& conn_str_password,unsigned short max_size);

	connection_ptr get_connection_ptr();
	void release_connection(connection_ptr ptrConn);
	void init_connection();

protected:
	static mysql_pool _pool;


protected:
	mysql_pool() {}
private:
	connection_ptr create_connection();
};